import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm'

@Entity('va_config')
export class ConfigEntity {
  @PrimaryGeneratedColumn()
  id: number

  @Column({ type: 'varchar', length: 50, unique: true, comment: '配置键' })
  key: string

  @Column({ type: 'text', nullable: true, comment: '配置值' })
  value: string

  @Column({ type: 'varchar', length: 100, nullable: true, comment: '配置名称' })
  name: string

  @Column({ type: 'varchar', length: 255, nullable: true, comment: '配置描述' })
  description: string

  @Column({ type: 'varchar', length: 20, nullable: true, comment: '配置类型' })
  type: string

  @Column({ type: 'json', nullable: true, comment: '配置选项' })
  options: any

  @Column({ type: 'boolean', default: false, comment: '是否为系统配置' })
  system: boolean

  @CreateDateColumn({ type: 'timestamp', comment: '创建时间' })
  createdAt: Date

  @UpdateDateColumn({ type: 'timestamp', comment: '更新时间' })
  updatedAt: Date
}
